import Vue from 'vue'
import Router from 'vue-router'
import AddEmployee from "./views/employee/AddEmployee.vue"
import AddApply from "./views/Apply/AddApply.vue"
import Login from "./views/Login/LoginPage.vue"
import Home from "./views/Home/HomePage.vue"
import ApplyList from "./views/Apply/ApplyList.vue"
import Test from "./views/test.vue"
import ManageApply from "./views/Apply/ManageApply.vue"
import EmployeCheck from "./views/Check/EmployeeCheck.vue"
import AllEmployeState from "./views/employee/AllEmployeState.vue"
import AllCheck from "./views/Check/AllCheck.vue"
import VocationLeft from "./views/Mine/VocationLeft.vue"
import AllEmployee from "./views/employee/AllEmployee.vue"
import EmployeeInfo from "./views/employee/EmployeeInfo.vue"
import MyInfo from "./views/Mine/MyInfo.vue"
import AllApplyList from "./views/Apply/AllApplyList.vue"
import AddDepartment from "./views/Department/AddDepartment.vue";
import Annualleave from "./views/Annualleave/AnnualleaveApply.vue";
import UpdateMyInfo from "./views/Mine/UpdateMyInfo";
import AnnualleaveRecord from "./views/Annualleave/AnnualleaveRecord";
import LevelAdjustmentRecord from "./views/Level/LevelAdjustmentRecord.vue";
import LevelAdjustment from "./views/Level/LevelAdjustment.vue";
import Welcome from "./views/Mine/Welcome.vue"
import DepartmentList from "./views/Department/DepartmentList";
import LeaveDashboard from "./views/Data/LeaveDashboard.vue";
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: '登录',
      component: Login
    }, {
      path: '/login',
      name: '登录',
      component: Login,
    },
    // {
    //   path: '/home',
    //   name: '',
    //   component: Home,
    // },
    {
      path: '/home',
      component: Home,
      name: '管理',
      children: [
        {
          path: '/Data/LeaveDashBoard',
          name: '数据展示',
          component: LeaveDashboard,
        },
        {
          path: '/Department/DepartmentList',
          name: '查询所有部门',
          component: DepartmentList,
        },
        {
          path: '/Mine/welcome',
          name: '欢迎界面',
          component: Welcome,
        },
        {
          path: '/apply/addApply',
          name: '添加申请',
          component: AddApply,
        }, {
          path: '/employee/AddDepartment',
          name: '添加部门',
          component: AddDepartment,
        },{
          path: '/employee/AddEmployee',
          name: '添加员工',
          component: AddEmployee,
        },{
          path: '/apply/applyList',
          name: '请假记录',
          component: ApplyList,
        }, {
          path: '/test',
          name: '测试',
          component: Test,
        }, {
          path: '/apply/ManageApply',
          name: '审核请假',
          component: ManageApply,
        }, {
          path: '/Check/EmployeCheck',
          name: '员工打卡',
          component: EmployeCheck,
        }, {
          path: '/employee/AllEmployeState',
          name: '员工状态',
          component: AllEmployeState,
        }, {
          path: '/Check/AllCheck',
          name: '所有打卡记录',
          component: AllCheck,
        }, {
          path: '/Mine/VocationLeft.vue',
          name: '剩余假期',
          component: VocationLeft,
        }, {
          path: '/employee/AllEmployee',
          name: '查询所有人员',
          component: AllEmployee,
        },   {
          path: '/employee/EmployeeInfo/:employeeId?',
          name: 'EmployeeInfo',
          component: EmployeeInfo,
          props: true // 启用 props，将路由参数作为 props 传递给组件
        }, {
          path: '/Mine/MyInfo',
          name: '我的详情',
          component: MyInfo,
        },{
          path: '/Mine/UpdateMyInfo',
          name: '修改我的信息',
          component: UpdateMyInfo,
        }, {
          path: '/Apply/AllApplyList',
          name: '所有请假申请',
          component: AllApplyList,
        },{
          path: '/Annualleave/AnnualleaveApply',
          name: '年假申请',
          component: Annualleave,
        },{
          path: '/Annualleave/AnnualleaveRecord',
          name: '年假申请记录',
          component: AnnualleaveRecord,
        },{
          path: '/OverTime/All',
          name: '加班总模块',
          component: () => import('./views/ApplyComOffAndOverTime/OverTimeApply.vue'),
        },{
          path: '/CompOff/All',
          name: '调休总模块',
          component: () => import('@/views/ApplyComOffAndOverTime/CompOffApply.vue'),
        },
        {
          path: '/Deal',
          component: ()=> import('@/views/ApplyComOffAndOverTime/DealApply.vue'),
          children: [
            {
              path: 'overtime',
              component:  ()=> import('@/views/ApplyComOffAndOverTime/Deal/OverTimeDeal.vue')
            },
            {
              path: 'compoff',
              component: ()=> import('@/views/ApplyComOffAndOverTime/Deal/CompOffDeal.vue')
            },
            {
              path: 'pending',
              component: ()=> import('@/views/ApplyComOffAndOverTime/Deal/MessageShow.vue')
            },
            {path: '', redirect: 'pending'}
          ]
        },
        {
          path: '/Level/LevelAdjustment',
          name: '调级管理',
          component: LevelAdjustment
        },
        {
          path: '/Level/LevelAdjustmentRecord',
          name: '调级记录查询',
          component: LevelAdjustmentRecord,
        }

      ]
    }
  ]
})